/*
 * DateTime.h
 *
 *  Created on: 2011-11-17
 *      Author: song
 */
#ifndef CMD_H_
#define CMD_H_

#define DEV_PORT  20131     /*服务器监听命令端口号 */
#define USR_PORT  20132     /*服务器监听命令端口号 */

//cmd

//admin->
#define MSG_ADMIN_DEV_ADD		0x1001
#define MSG_ADMIN_DEV_ADD_ACK	0x1002

#define MSG_ADMIN_DEV_DELETE 	 0x1003
#define MSG_ADMIN_DEV_DELETE_ACK 0x1004

#define MSG_ADMIN_USR_ADD 		0x1005
#define MSG_ADMIN_USR_ADD_ACK 	0x1006

#define MSG_ADMIN_USR_DELETE 	 0x1007
#define MSG_ADMIN_USR_DELETE_ACK 0x1008


//user->
#define MSG_USR_LOGIN			0x2000
#define MSG_USR_LOGIN_ACK		0x2001

#define MSG_USR_REG				0x2002
#define MSG_USR_REG_ACK			0x2003

#define MSG_USR_BIND_DEV	    0x2004
#define MSG_USR_BIND_DEV_ACK	0x2005

#define MSG_USR_UNBIND_DEV	    0x2006
#define MSG_USR_UNBIND_DEV_ACK	0x2007

#define MSG_USR_CHANGE_PSWD		0x2008
#define MSG_USR_CHANGE_PSWD_ACK	0x2009


//user->
#define MSG_CONFIG_WIFI         0x2100
#define MSG_CONFIG_WIFI_ACK     0x2101

#define MSG_SET_RELAY			0x2102
#define MSG_SET_RELAY_ACK		0x2103

#define  MSG_CX_ALL_VALUE			0x2104
#define  MSG_CX_ALL_VALUE_ACK		0x2105

#define MSG_CX_DEV_ONLINE_OR_OFFLINE		0x2106
#define MSG_CX_DEV_ONLINE_OR_OFFLINE_ACK	0x2107


//plug->
#define MSG_UP_ALL_VALUE			0x3001
#define MSG_DEV_CHANGE_PSWD			0x3002
#define MSG_DEV_CHANGE_PSWD_ACK		0x3003



//状态值
#define STATUS_SUCCESS				0x00 //设置成功
#define STATUS_FAILED				0x01 //设置失败
#define STATUS_DEV_OFFLINE			0x02
#define STATUS_DEV_ONLINE			0x03

#define STATUS_TURNOFF              	0x04
#define STATUS_TURNON              		0x05

#define STATUS_USR_INVALIDE			0x06
#define STATUS_PSWD_INVALIDE		0x07

#define STATUS_USR_BIND_DEV_INVALID_DEV		0x08
#define STATUS_USR_BIND_DEV_ALREADY_BIND	0x09



#endif


